<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/4/11
 * Time: 16:18
 */

namespace app\common\controller;


use Wechat\Wxobjopen;

class CardTims extends Wxoption
{

    //微信通知
    public function updatetims($arr){
        try {
            //实例化微信
            $options = $this->options($arr['card_id']);
            $WxObj = new Wxobjopen($options);
            $data = [
                'code' => $arr['code'],
                'card_id' => $arr['card_id'],
//                'record_bonus' => $arr['record_bonus'],       //说明
//                'add_bonus' => $arr['bonus'],             //积分变动值  负数为减少
                'notify_optional' => [
                    'is_notify_bonus' => false,
                    'is_notify_balance' => false,
                    'is_notify_custom_field3' => $arr['tims'],
                ],
            ];
            $res = $WxObj->updateUserInfo($data);
        } catch (\Exception $e) {
            $res = ['errcode' => 9999, 'message' => $e->getMessage()];
        }
        return $res;
    }

}